<?php

/**
 * LEAGUEMan
 * 
 * Copyright (C) 2007 Marko Bischof
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

?>

<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
		
		if (form.name.value == ""){
			alert( "League must have a name!" );
		}
		else{
			submitform( pressbutton );
		}
	}
</script>

<table cellpadding="4" cellspacing="0" border="0" width="100%">
	<tr>
    	<td width="100%">
			<span class="sectionname">
				<?php echo $this->row->league_id ? 'Edit' : 'New';?> <?php echo 'League';?>
			</span>
		</td>
	</tr>
</table>

<form action="index2.php" method="post" name="adminForm" id="adminForm">
	
	<table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
		<tr>
			<td width="20%" align="right"><?php echo 'Name';?>:</td>
			<td width="80%">
				<input class="inputbox" type="text" name="league_name" size="50" maxlength="250" value="<?php echo $this->row->league_name;?>" />
			</td>
		</tr>
		<tr>
			<td width="20%" align="right"><?php echo 'Order';?>:</td>
			<td width="80%">
				<?php echo $this->list;?>
			</td>
		</tr>
	</table>
	
	<input type="hidden" name="season_id" value="<?php echo $this->row->league_id; ?>" />
	<input type="hidden" name="option" value="com_leagueman" />
	<input type="hidden" name="act" value="leagues" />
	<input type="hidden" name="task" value="" />
</form>